import aima.core.agent.Action;
import aima.core.search.framework.ResultFunction;

public class PacmanResultFunction implements ResultFunction {

	@Override
	public Object result(Object s, Action a) {
		final PacmanMap map = (PacmanMap) s;
		final PacmanAction action = (PacmanAction) a;

		final Point newPacmanLocation = action.giveNewPacmanLocation(map.getPacmanLocation());
		final PacmanMap newMap = map.setPacmanLocation(newPacmanLocation);

		System.out.println(action.toString());
		newMap.printMap();
		return newMap;

	}

}